﻿using System.ComponentModel.DataAnnotations.Schema;
using Abp.Domain.Values;

namespace DHJ.Cost.ManHours
{
    public class ManHour : ValueObject<ManHour>
    {
        private ManHour()
        {
        }

        public ManHour(decimal standard)
        {
            Standard = standard;
        }

        public ManHour(decimal standard, decimal workshopTotal):this(standard)
        {
            WorkshopTotal = workshopTotal;
            Percentage = standard / workshopTotal;
        }

        [Column("StandardManHour")]
        public decimal Standard { get;  set; }

        [Column("WorkshopManHour")]
        public decimal WorkshopTotal { get; private set; }

        public decimal Percentage { get; private set; }
    }
}